﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include "hapticdv.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
private:
    void initforms();
    void calibrationForce();
    void updateHandPosition(std::vector<double> pos);
    void updateHandSpeed(std::vector<double> pos);
private slots:
    void slot_connectestablished();
    void slot_disconnected();
    void slot_datarefresh();
    void on_pushButton_calib_clicked();

    void on_horizontalSlider_valueChanged(int value);

    void on_horizontalSlider_2_valueChanged(int value);

private:
    Ui::MainWindow *ui;
    QTimer* refreshtimer;
    HapticDV* hap_;
    int IO_input=0;
    double factor_=0;
    std::vector<double> zerofactor_;
    int forcecount=0;

};
#endif // MAINWINDOW_H
